<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
  <!-- Switchery -->
  <link href="../cms/vendors/switchery/dist/switchery.min.css" rel="stylesheet">
  <!-- Dropzone.js -->
  <link href="../cms/vendors/dropzone/dist/min/dropzone.min.css" rel="stylesheet">
  <!-- iCheck -->
  <link href="../cms/vendors/iCheck/skins/flat/green.css" rel="stylesheet">
  <!-- Custom Theme Style -->
  <link href="../cms/build/css/custom.css" rel="stylesheet">
</head>
  <body class="nav-md">
    <div class="page-title">
      <div class="title_left">
        <h3>新增专栏</h3>
      </div>
      <div class="title_right">
       	<div class="pull-right">
       		<a onclick="goSubject()" class="btn btn-app">
       			<i class="fa fa-file"></i>返回
       		</a>
       	</div>
       </div>
    </div>
    
    <div class="clearfix"></div>

	<div class="row">
      <div class="col-md-12 col-sm-12 col-xs-12">
        <div class="x_panel">
          <div class="x_content">
            <br />
            <form id="demo-form2" data-parsley-validate class="form-horizontal form-label-left">
              <div class="form-group">
                <label class="control-label col-md-2 col-sm-2 col-xs-12" for="subjectName">专栏名称 <span class="required">*</span></label>
                <div class="col-md-4 col-sm-4 col-xs-12">
                  <input type="text" id="subjectName" required="required" class="form-control col-md-7 col-xs-12">
                </div>
                <label class="control-label col-md-1 col-sm-1 col-xs-12" for="realName">主讲人姓名 <span class="required">*</span></label>
                <div class="col-md-4 col-sm-4 col-xs-12">
                  <select id="realName" class="select2_single form-control" tabindex="-1" onclick="syncUserName()">
                    <option></option>
                  	<option th:each="user : ${userList}" th:value="${user.userName + user.id}" th:text="${user.realName}"></option>
                  </select>
                </div>
              </div>
              <div class="form-group">
                <label class="control-label col-md-2 col-sm-2 col-xs-12" for="userIntroduce">主讲人介绍 <span class="required">*</span>
                </label>
                <div class="col-md-4 col-sm-4 col-xs-12">
                  <input type="text" id="userIntroduce" name="last-name" required="required" class="form-control col-md-7 col-xs-12">
                </div>
                <label class="control-label col-md-1 col-sm-1 col-xs-12" for="userName">主讲人账号 <span class="required">*</span>
                </label>
                <div class="col-md-4 col-sm-4 col-xs-12">
                  <input type="text" id="userName" class="form-control col-md-7 col-xs-12" disabled="disabled" required="required">
                  <input type="text" id="teacherId" style="display:none;" >
                </div>
              </div>
              <div class="form-group">
                <label for="subjectIntroduce" class="control-label col-md-2 col-sm-2 col-xs-12">专栏简介 <span class="required">*</span></label>
                <div class="col-md-9 col-sm-9 col-xs-12">
                  <textarea id="subjectIntroduce" class="form-control" name="subjectIntroduce" required="required"></textarea>
                </div>
              </div>
              <div class="form-group">
                <label for="subjectDropzone" class="control-label col-md-2 col-sm-2 col-xs-12">专栏图片</label>
                <div class="col-md-9 col-sm-9 col-xs-12">
                  <div id="subjectDropzone" class="dropzone"></div>
                  <input type="hidden" id="subjectPicUrl">
                </div>
              </div>
              <div class="form-group">
                <label for="subscribePrice" class="control-label col-md-2 col-sm-2 col-xs-12">订阅金额 <span class="required">*</span></label>
                <div class="col-md-4 col-sm-4 col-xs-12">
                  <input type="number" id="subscribePrice" class="form-control col-md-7 col-xs-12" name="subscribePrice"
                       th:disabled="${roleType eq '1'}" required="required">
                </div>
              </div>
              <div class="form-group">
                <label for="freeCourseFlag" class="control-label col-md-2 col-sm-2 col-xs-12">分享得免费课程 <span class="required">*</span></label>
                <div class="col-md-4 col-sm-4 col-xs-12">
					<input id="freeCourseFlag" type="checkbox" class="js-switch" th:disabled="${roleType eq '1'}">
                </div>
              </div>
              <div class="form-group">
                <label for="freeCourseFlag" class="control-label col-md-2 col-sm-2 col-xs-12">专栏介绍（详细）</label>
                <div class="col-md-9 col-sm-9 col-xs-12">
                  <div id="editor-one"></div>
                </div>
              </div>
              <div class="ln_solid"></div>
              <div class="form-group">
                <div class="col-md-12 col-sm-12 col-xs-12 col-md-offset-5">
                  <button class="btn btn-primary" type="button" onclick="goSubject()">返回</button>
                  <button id="btnSubjectAdd" class="btn btn-success" type="submit" onclick="addSubject()">新增</button>
                </div>
              </div>
            </form>
          </div>
        </div>
      </div>
    </div>


    <!-- wangEditor-->
    <script src="../cms/vendors/wangEditor/release/wangEditor.js"></script>
    <!-- Switchery -->
    <script src="../cms/vendors/switchery/dist/switchery.min.js"></script>
    <!-- Dropzone.js -->
    <script src="../cms/vendors/dropzone/dist/dropzone.js"></script>
    <!-- Parsley -->
    <script src="../cms/vendors/parsleyjs/dist/parsley.min.js"></script>
    <!-- Custom Theme Scripts -->
    <script src="../cms/build/js/custom.js"></script>
    <script src="../cms/js/subject.js"></script>
    <script src="../cms/js/subject_add.js"></script>
  </body>
</html>